﻿using System;
using System.Collections.Generic;

namespace QuanLyNganHangDe.DAL.Models
{
    public partial class DeInRa
    {
        public string TenHocPhan
        {
            get
            {
                if (this.HocPhan == null)
                    return "???";
                else
                    return this.HocPhan.TenHocPhan;
            }
        }

        public int SoTinChi
        {
            get
            {
                return this.HocPhan == null ? -1 : this.HocPhan.SoTinChi;
            }
        }

        //public string DeInRaFilePath
        //{
        //    get
        //    {
        //        string exeDirPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
        //        string dataDirPath = System.IO.Path.Combine(exeDirPath, "DE");
        //        //if (System.IO.Directory.Exists(dataDirPath) == false)
        //        //    System.IO.Directory.CreateDirectory(dataDirPath);
        //        string dotThiDirPath = System.IO.Path.Combine(dataDirPath, this.MaDotThi);
        //        //if (System.IO.Directory.Exists(dotThiDirPath) == false)
        //        //    System.IO.Directory.CreateDirectory(dotThiDirPath);
        //        var dethiFilePath = System.IO.Path.Combine(dotThiDirPath, this.MaDeThi + "-de.rtf");
        //        return dethiFilePath;
        //    }
        //}

        //public string DapAnInRaFilePath
        //{
        //    get
        //    {
        //        string exeDirPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
        //        string dataDirPath = System.IO.Path.Combine(exeDirPath, "DE");
        //        //if (System.IO.Directory.Exists(dataDirPath) == false)
        //        //    System.IO.Directory.CreateDirectory(dataDirPath);
        //        string dotThiDirPath = System.IO.Path.Combine(dataDirPath, this.MaDotThi);
        //        //if (System.IO.Directory.Exists(dotThiDirPath) == false)
        //        //    System.IO.Directory.CreateDirectory(dotThiDirPath);
        //        var dapanFilePath = System.IO.Path.Combine(dotThiDirPath, this.MaDeThi + "-da.rtf");
        //        return dapanFilePath;
        //    }

        //}

        public string NoiDungDeThiFilePath_Relative
        {
            get { return string.Format("{0}\\{1}-de.rtf", MaDotThi, MaDeThi); }
        }

        public string NoiDungDapAnFilePath_Relative
        {
            get { return string.Format("{0}\\{1}-da.rtf", MaDotThi, MaDeThi); }
        }
    }
}
